package com.yong.es.pinyin.jopo;

import com.yong.es.pinyin.constant.Constants;
import lombok.Data;
import org.springframework.data.elasticsearch.annotations.*;

import javax.persistence.Entity;
import javax.persistence.Id;

/**
 * 课程实体类
 *
 * @author 庾雍
 */
@Entity
@Data
@Document(indexName = Constants.INDEX_NAME)
public class Course {

    @Id
    private Long id;
    private String course_name; // 课程名称
    private String keyword; // 关键字
    @MultiField(
            mainField = @Field(type = FieldType.Keyword),
            otherFields = {
                    @InnerField(suffix = "pinyin",
                            type = FieldType.Text,
                            store = false,
                            termVector = TermVector.with_offsets,
                            analyzer = "pinyin_analyzer"
                    )
            }
    )
    private String lecturer; // 主讲教师
}

